package pers.cj.pdos.controller.entity;

/**
 * 普通响应json体
 */
public class ResponseEntity extends BaseEntity {
    public ResponseEntity() {
    }

    public ResponseEntity(int code, String msg) {
        super(code, msg);
    }

    public static ResponseEntity success(){
        ResponseEntity entity = new ResponseEntity();
        entity.setCode(1);
        entity.setMsg("处理成功");
        return entity;
    }

    public static ResponseEntity success(String msg){
        ResponseEntity entity = new ResponseEntity();
        entity.setCode(1);
        entity.setMsg(msg);
        return entity;
    }

    public static ResponseEntity fail(String msg){
        ResponseEntity entity = new ResponseEntity();
        entity.setCode(2);
        entity.setMsg(msg);
        return entity;
    }
}
